﻿<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>

   <script src="~/Scripts/tinymce/tinymce.min.js"></script>
    <script src="~/Scripts/jquery-easyui-1.3.4/jquery.min.js"></script>
    <script src="~/Scripts/jquery-easyui-1.3.4/jquery.easyui.min.js"></script>
    <link href="~/Scripts/jquery-easyui-1.3.4/themes/default/easyui.css" rel="stylesheet" />
    <link href="~/Scripts/jquery-easyui-1.3.4/themes/icon.css" rel="stylesheet" />
    <link href="~/Scripts/jquery-easyui-1.3.4/demo/demo.css" rel="stylesheet" />
</head>
<body>
<h2>Tree1</h2>
<ul id="tt" class="easyui-tree">
    <li>
        <span>My Documents</span>
        <ul>
            <li data-options="state:'closed'">
                <span>Photos</span>
                <ul>
                    <li>
                        <span>Friend</span>
                    </li>
                    <li>
                        <span>Wife</span>
                    </li>
                    <li>
                        <span>Company</span>
                    </li>
                </ul>
            </li>
            <li>
                <span>Program Files</span>
                <ul>
                    <li>Intel</li>
                    <li>Java</li>
                    <li>Microsoft Office</li>
                    <li>Games</li>
                </ul>
            </li>
            <li>index.html</li>
            <li>about.html</li>
            <li>welcome.html</li>
        </ul>
    </li>
</ul>

<script type="text/javascript">

    $(document).ready(function(){
        $('#tt').tree({onSelect:function(node){
           var p = $('#tt').tree('getParent',node.target);
           var url_arr = [];
            url_arr[0] = node.text;
            while(p){
                url_arr[url_arr.length] = p.text;

                p = $('#tt').tree('getParent',p.target);
            }

            var url = "";
            for(var i = url_arr.length - 1; i >= 0; i--){
                if(i != 0){
                    url += url_arr[i] + "/";
                }
                else
                    url += url_arr[i];
            }

           window.localStorage['tinymce_return_url'] = url;
        }});
    });
</script>

</body>
</html>